package com.lottery.common.contants;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import static org.bouncycastle.asn1.x500.style.RFC4519Style.o;

/**
 * Created by superv on 2017/6/23.
 */

@ApiModel(value="ReQueryResult对象",description="公共返回对象ReQueryResult")
//@JsonInclude(JsonInclude.Include.NON_NULL)
@Data
public class ReQueryResult<T> {
    /**
     * 登录结果码，000表示成功，非000表示失败
     */
    @ApiModelProperty(value = "返回码")
    private String resultCode;
    /**
     * 登录结果码描述信息
     */
    @ApiModelProperty(value = "描述 000成功")
    private String resultDesc;
    //业务数据
    @ApiModelProperty(value = "数据")
    private Object data;

    @ApiModelProperty(value = "对象")
    private T resultObj;

    @ApiModelProperty(value = "是否会员 0 是 1 否")
    private Integer isExpired=1;

//    @ApiModelProperty(value = "总页数")
//    private Integer recordsTotal;
//    @ApiModelProperty(value = "")
//    private Integer recordsFiltered;

//    @ApiModelProperty(value = "是否需要更新 0需要更新")
//    private Integer isUpdateToken;
//
//    @ApiModelProperty(value = "需要更新时有值")
//    private String token;
//

    public void success(String msg){
        resultCode = TYPE_ZERO_ZERO_STR;
        resultDesc = msg;
    }

    public void error(String msg){
        resultCode = TYPE_ONE_HUNDRED_STR;
        resultDesc=msg;
    }

    public void loginError(String msg){
        resultCode = TYPE_ONE_HUNDRED_TWO_STR;
        resultDesc=msg;
    }

    //结果码
    public static final String TYPE_ZERO_ZERO_STR="000"; //成功
    public static final String TYPE_ONE_HUNDRED_STR="100"; // 失败
    public static final String TYPE_ONE_HUNDRED_ONE_STR="101";//
    public static final String TYPE_ONE_HUNDRED_TWO_STR="102";//登录失败
    public static final String TYPE_ONE_HUNDRED_THREE_STR="103";//未注册
    public static final String TYPE_ONE_HUNDRED_FOUR_STR="104";//验证码登录 未注册
    public static final String TYPE_ONE_HUNDRED_FIVE_STR="105";//尚未购买
    public static final String TYPE_ONE_HUNDRED_SIX_STR="106";//未设置支付密码
    public static final String TYPE_ONE_HUNDRED_SEVEN_STR="107";//ios登录失败



}
